/********************************************************************************
TITLE:                      	Using Virtual Functions
FILENAME:                   	videodvd.cpp
PREPARED FOR:               	CS215 Section CS13-02
PROGRAMMER(S):              	Eric (Fox) Crowell, Timothy Drye
DEVELOPMENT DATE:           	< 12/15/13 >
COMPILER USED:      			Microsoft Visual Studio Professional 2013
- Version 12.0.21005.1 REL
TARGET PLATFORM:         	    Windows 8 x64
================================================================================
REVISION HISTORY

DATE         PROGRAMMER          DESCRIPTION OF CHANGES MADE
------------------------------------------------------------------------------
<12/18/13       Fox                 Class Created.                           >
*******************************************************************************/

#include "videodvd.h"

// For the default constructor, call the parent's and set. [Fox]
VideoDVD::VideoDVD() :Media() {
	cout << "      --- Number of Scenes: ";
	cin >> NumberOfScenes; // Int
	if (NumberOfScenes < 1){ NumberOfScenes = 1; }
	cout << "      [i] Your \"Video DVD\" media item has been created.\n";
	cout << "      --------------------------------------------------\n\n";
}

// Overloaded constructor. [Fox]
VideoDVD::VideoDVD(const string  & InTitle, const string & InArtist, const string & InWherePurchased,
	float InCost, Time  & InRunningTime, int InNumberOfScenes)
	:Media(InTitle, InArtist, InWherePurchased, InCost, InRunningTime) {
	NumberOfScenes = InNumberOfScenes;
}

// Returns the boolean data member IsDVD_AtBeginning. [Fox]
bool VideoDVD::IsDVD_AtBeginning() {
	return(DVD_AtBeginning);
}

// Returns the boolean data member DVD_AtEnd. [Fox]
bool VideoDVD::IsDVD_AtEnd(){
	return(DVD_AtEnd);
}

// Returns the boolean data member NumberOfScenes. [Fox]
int VideoDVD::GetNumberOfScenes(){
	return(NumberOfScenes);
}

// Returns the boolean data member CurrentTrack. [Fox]
int VideoDVD::GetCurrentScene(){
	return(CurrentScene);
}

// Play the media (Progresses the end of the media). [Fox]
void VideoDVD::Play(){
	if (IsDVD_AtEnd() || CurrentScene > NumberOfScenes){
		cout << "\n      [!] This media has reached the end of its playlist. Please rewind the media before playing.\n\n";
		DVD_AtBeginning = false;
		DVD_AtEnd = true;
	}
	else{
		cout << "\n      [i] Media has just played scene #" << CurrentScene << ".\n";
		CurrentScene++;
		if (CurrentScene <= NumberOfScenes){
			cout << "      [i] Next track is #" << CurrentScene << ".\n\n";
		}
		else {
			cout << "      [i] That was the last track in the playlist.\n\n";
		}
		DVD_AtBeginning = false;
		DVD_AtEnd = false;
	}
}

// Fast forward to the end of the media. [Fox]
void VideoDVD::FastForward(){
	if (IsDVD_AtEnd()){
		cout << "\n      [!] This media is already at the end.\n\n";
	}
	else {
		cout << "\n      [i] Media has been fast forwarded to the end.\n\n";
		DVD_AtBeginning = false;
		DVD_AtEnd = true;
	}
}

// Rewind to the beginning of the media. [Fox]
void VideoDVD::Rewind(){
	if (IsDVD_AtBeginning()){
		cout << "\n      [!] This media is already at the beginning.\n\n";
	}
	else {
		cout << "\n      [i] Media has been rewound to the beginning.\n\n";
		DVD_AtBeginning = true;
		DVD_AtEnd = false;
	}
}

// Prints out the information about the media. [Fox]
void VideoDVD::PrintMedia(ostream & Out){
	Media::PrintMedia(Out); // Call the parent's PrintMedia to output its data members.
	Out << "      --- Number of Scenes: " << NumberOfScenes << "\n";
	Out << "      --- Media Type: Video DVD\n";
	Out << "      --------------------------------------------------\n\n";
}